package iterator;import java.util.ArrayList;import java.util.Iterator;/** * Created by Administrator on 2018-10-29. */public class PancakeHouseMenu implements Menu {    ArrayList menuItems;    public PancakeHouseMenu(){        menuItems = new ArrayList();        addItem("K&B","Pancakes with scrambled eggs",true,2.99);        addItem("Regular Pancake BreakFast","Pancakes with fried eggs",true,2.99);        addItem("Waffles","Pancakes made with fresh blueBerries",true,2.99);    }    public void addItem(String name,String description,boolean vegetarian,double price){        MenuItem menuItem = new MenuItem(name,description,vegetarian,price);        menuItems.add(menuItem);    }     public Iterator createIterator(){       // return  new PancakeHouseIterator(menuItems);//调用自己写的Iterator 接口         return menuItems.iterator();//调用java util 的Iterator    }}